// SimNet is a Second Life(tm) sim mangement tool that was designed for Fermi Sandbox
// Copyright (C) 2011 Arthur Fermi
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// To receive a copy of this license please visit http://www.gnu.org/licenses/

// SimNet - Listner

// Global Variabless
integer gintOnOff;  //1 On, 0 Off
integer intCH1;
integer intCH2;
integer intCH3;
integer intCH4;
integer intCH5;
integer intCH6;
integer intCH7;
integer intCH8;
integer intCH9;
integer intCH10;
integer intCH11;
integer intCH12;
integer intCH13;
integer intCH14;
integer intCH15;
integer intCH16;
integer intCH17;
integer intCH18;
integer intCH19;
integer intCH20;
integer intCH21;
integer intCH22;
integer intCH23;
integer intCH24;
integer intCH25;
integer intCH50;
integer intCH99;
integer intCH100;
integer intCH101;
integer intCH102;

funListenOn()
{
    // Setup Listens
    intCH1  = llListen( 1, "", NULL_KEY, "" );
    intCH2  = llListen( 2, "", NULL_KEY, "" );
    intCH3  = llListen( 3, "", NULL_KEY, "" );
    intCH4  = llListen( 4, "", NULL_KEY, "" );
    intCH5  = llListen( 5, "", NULL_KEY, "" );
    intCH6  = llListen( 6, "", NULL_KEY, "" );
    intCH7  = llListen( 7, "", NULL_KEY, "" );
    intCH8  = llListen( 8, "", NULL_KEY, "" );
    intCH9  = llListen( 9, "", NULL_KEY, "" );
    intCH10  = llListen( 10, "", NULL_KEY, "" );
    intCH11  = llListen( 11, "", NULL_KEY, "" );
    intCH12  = llListen( 12, "", NULL_KEY, "" );
    intCH13  = llListen( 13, "", NULL_KEY, "" );
    intCH14  = llListen( 14, "", NULL_KEY, "" );
    intCH15  = llListen( 15, "", NULL_KEY, "" );
    intCH16  = llListen( 16, "", NULL_KEY, "" );
    intCH17  = llListen( 17, "", NULL_KEY, "" );
    intCH18  = llListen( 18, "", NULL_KEY, "" );
    intCH19  = llListen( 19, "", NULL_KEY, "" );
    intCH20  = llListen( 20, "", NULL_KEY, "" );
    intCH21  = llListen( 21, "", NULL_KEY, "" );
    intCH22  = llListen( 22, "", NULL_KEY, "" );
    intCH23  = llListen( 23, "", NULL_KEY, "" );
    intCH24  = llListen( 24, "", NULL_KEY, "" );
    intCH25  = llListen( 25, "", NULL_KEY, "" );
    intCH50  = llListen( 50, "", NULL_KEY, "" );
    intCH99  = llListen( 99, "", NULL_KEY, "" );
    intCH100  = llListen( 100, "", NULL_KEY, "" );
    intCH101  = llListen( 101, "", NULL_KEY, "" );
    intCH102  = llListen( 102, "", NULL_KEY, "" );
}

default
{
    state_entry()
    {
        funListenOn();
    }
    
    listen( integer channel, string name, key id, string message )
    {
       // if (id == llGetOwner())
        //{
            // Ignore stuff from yourself
        //}
       // else
        //{
            llOwnerSay(llKey2Name(id) + " said on channel " + (string)channel + "\n      " + message);
        //}
    }
    on_rez(integer start_param)
    {
        llSetScriptState(llGetScriptName(), FALSE);
        llResetScript();    
    }

}
